﻿CREATE  proc [dbo].[danhmuckhosua]
@makho varchar(255),
@tenkho nvarchar(255),
@loai nvarchar(255),
@ma_tk nvarchar(255),
@makho_old varchar(255)
as
if exists(select * from DM_KHO  Where makho <>@makho and ten_kho=@tenkho  )
begin
select ErrCode=0
end
else
begin
update DM_KHO  set ten_kho=@tenkho, loai=@loai,ma_tk=@ma_tk  WHere makho =@makho_old
select ErrCode=1
end